package com.mccrea.pattern.expression;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * @Classname TerminalExpression
 * @Description 终结符表达式类
 * @Date 2021/5/24 0024 14:29
 * @Created by Mccrea_Gao
 */
public class TerminalExpression implements AbstractExpression{

    private Set<String> set = new HashSet<>();

    public TerminalExpression(String[] datas) {
        Collections.addAll(set, datas);
    }

    @Override
    public boolean interpret(String info) {
        return set.contains(info);
    }
}
